<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
	.KEYW {color: #933;}
	.COMM {color: #bbb; font-style: italic;}
	.NUMB {color: #393;}
	.STRN {color: #393;}
	.REGX {color: #339;}
	.line {border-right: 1px dotted #666; color: #666; font-style: normal;}
	</style></head><body><pre><span class='line'>  1</span> <span class="COMM">/*****************************************************************************
<span class='line'>  2</span> * Cal3D 3d character animation library
<span class='line'>  3</span> * Copyright (C) 2001, 2002 Bruno 'Beosil' Heidelberger
<span class='line'>  4</span> *
<span class='line'>  5</span> * This library is free software; you can redistribute it and/or modify it
<span class='line'>  6</span> * under the terms of the GNU Lesser General Public License as published by
<span class='line'>  7</span> * the Free Software Foundation; either version 2.1 of the License, or (at
<span class='line'>  8</span> * your option) any later version.
<span class='line'>  9</span> *****************************************************************************/</span><span class="WHIT">
<span class='line'> 10</span> 
<span class='line'> 11</span> </span><span class="COMM">/*****************************************************************************
<span class='line'> 12</span> * Cal3DJS Javascript port of Cal3D for WebGL and canvas applications
<span class='line'> 13</span> * by Humu humu2009@gmail.com
<span class='line'> 14</span> * http://code.google.com/p/cal3djs/
<span class='line'> 15</span> *****************************************************************************/</span><span class="WHIT">
<span class='line'> 16</span> 
<span class='line'> 17</span> 
<span class='line'> 18</span> </span><span class="COMM">/**
<span class='line'> 19</span> 	@namespace CalError
<span class='line'> 20</span> */</span><span class="WHIT">
<span class='line'> 21</span> </span><span class="NAME">Cal3D.CalError</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 22</span> 
<span class='line'> 23</span> </span><span class="COMM">/**
<span class='line'> 24</span> 	The error code enumerations.
<span class='line'> 25</span> */</span><span class="WHIT">
<span class='line'> 26</span> </span><span class="NAME">Cal3D.CalError.Code</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 27</span> </span><span class="WHIT">	</span><span class="NAME">OK</span><span class="PUNC">:</span><span class="WHIT">							</span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'> 28</span> </span><span class="WHIT">	</span><span class="NAME">INTERNAL</span><span class="PUNC">:</span><span class="WHIT">					</span><span class="NUMB">1</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'> 29</span> </span><span class="WHIT">	</span><span class="NAME">INVALID_HANDLE</span><span class="PUNC">:</span><span class="WHIT">				</span><span class="NUMB">2</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'> 30</span> </span><span class="WHIT">	</span><span class="NAME">MEMORY_ALLOCATION_FAILED</span><span class="PUNC">:</span><span class="WHIT">	</span><span class="NUMB">3</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'> 31</span> </span><span class="WHIT">	</span><span class="NAME">FILE_NOT_FOUND</span><span class="PUNC">:</span><span class="WHIT">				</span><span class="NUMB">4</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'> 32</span> </span><span class="WHIT">	</span><span class="NAME">INVALID_FILE_FORMAT</span><span class="PUNC">:</span><span class="WHIT">		</span><span class="NUMB">5</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'> 33</span> </span><span class="WHIT">	</span><span class="NAME">FILE_PARSER_FAILED</span><span class="PUNC">:</span><span class="WHIT">			</span><span class="NUMB">6</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'> 34</span> </span><span class="WHIT">	</span><span class="NAME">INDEX_BUILD_FAILED</span><span class="PUNC">:</span><span class="WHIT">			</span><span class="NUMB">7</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'> 35</span> </span><span class="WHIT">	</span><span class="NAME">NO_PARSER_DOCUMENT</span><span class="PUNC">:</span><span class="WHIT">			</span><span class="NUMB">8</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'> 36</span> </span><span class="WHIT">	</span><span class="NAME">INVALID_ANIMATION_DURATION</span><span class="PUNC">:</span><span class="WHIT">	</span><span class="NUMB">9</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'> 37</span> </span><span class="WHIT">	</span><span class="NAME">BONE_NOT_FOUND</span><span class="PUNC">:</span><span class="WHIT">				</span><span class="NUMB">10</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'> 38</span> </span><span class="WHIT">	</span><span class="NAME">INVALID_ATTRIBUTE_VALUE</span><span class="PUNC">:</span><span class="WHIT">	</span><span class="NUMB">11</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'> 39</span> </span><span class="WHIT">	</span><span class="NAME">INVALID_KEYFRAME_COUNT</span><span class="PUNC">:</span><span class="WHIT">		</span><span class="NUMB">12</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'> 40</span> </span><span class="WHIT">	</span><span class="NAME">INVALID_ANIMATION_TYPE</span><span class="PUNC">:</span><span class="WHIT">		</span><span class="NUMB">13</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'> 41</span> </span><span class="WHIT">	</span><span class="NAME">FILE_CREATION_FAILED</span><span class="PUNC">:</span><span class="WHIT">		</span><span class="NUMB">14</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'> 42</span> </span><span class="WHIT">	</span><span class="NAME">FILE_WRITING_FAILED</span><span class="PUNC">:</span><span class="WHIT">		</span><span class="NUMB">15</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'> 43</span> </span><span class="WHIT">	</span><span class="NAME">INCOMPATIBLE_FILE_VERSION</span><span class="PUNC">:</span><span class="WHIT">	</span><span class="NUMB">16</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'> 44</span> </span><span class="WHIT">	</span><span class="NAME">NO_MESH_IN_MODEL</span><span class="PUNC">:</span><span class="WHIT">			</span><span class="NUMB">17</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'> 45</span> </span><span class="WHIT">	</span><span class="NAME">BAD_DATA_SOURCE</span><span class="PUNC">:</span><span class="WHIT">			</span><span class="NUMB">18</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'> 46</span> </span><span class="WHIT">	</span><span class="NAME">NULL_BUFFER</span><span class="PUNC">:</span><span class="WHIT">				</span><span class="NUMB">19</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'> 47</span> </span><span class="WHIT">	</span><span class="NAME">INVALID_MIXER_TYPE</span><span class="PUNC">:</span><span class="WHIT">			</span><span class="NUMB">20</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'> 48</span> </span><span class="WHIT">	</span><span class="NAME">MAX_ERROR_CODE</span><span class="PUNC">:</span><span class="WHIT">				</span><span class="NUMB">21</span><span class="WHIT">
<span class='line'> 49</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 50</span> 
<span class='line'> 51</span> </span><span class="COMM">/**
<span class='line'> 52</span> 	Get the code of the last error.&lt;br />
<span class='line'> 53</span> 	@returns {number} The code of the last error.
<span class='line'> 54</span> */</span><span class="WHIT">
<span class='line'> 55</span> </span><span class="NAME">Cal3D.CalError.getLastErrorCode</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 56</span> </span><span class="WHIT">	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">Cal3D.CalError.m_lastErrorCode</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 57</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 58</span> 
<span class='line'> 59</span> </span><span class="COMM">/**
<span class='line'> 60</span> 	Get the name of the source file where the last error occured.&lt;br />
<span class='line'> 61</span> 	@returns {string} The name of the file where the last error occured.
<span class='line'> 62</span> */</span><span class="WHIT">
<span class='line'> 63</span> </span><span class="NAME">Cal3D.CalError.getLastErrorFile</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 64</span> </span><span class="WHIT">	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">Cal3D.CalError.m_lastErrorFile</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 65</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 66</span> 
<span class='line'> 67</span> </span><span class="COMM">/**
<span class='line'> 68</span> 	Get the line number in the source file where the last error occured.&lt;br />
<span class='line'> 69</span> 	@returns {number} The line number where the last error occured.
<span class='line'> 70</span> */</span><span class="WHIT">
<span class='line'> 71</span> </span><span class="NAME">Cal3D.CalError.getLastErrorLine</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 72</span> </span><span class="WHIT">	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">Cal3D.CalError.m_lastErrorLine</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 73</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 74</span> 
<span class='line'> 75</span> </span><span class="COMM">/**
<span class='line'> 76</span> 	Get the supplementary description of the last error.&lt;br />
<span class='line'> 77</span> 	@returns {string} The supplementary description of the last error.
<span class='line'> 78</span> */</span><span class="WHIT">
<span class='line'> 79</span> </span><span class="NAME">Cal3D.CalError.getLastErrorText</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 80</span> </span><span class="WHIT">	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">Cal3D.CalError.m_lastErrorText</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 81</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 82</span> 
<span class='line'> 83</span> </span><span class="COMM">/**
<span class='line'> 84</span> 	Dump all information about the last error to the standard output.&lt;br />
<span class='line'> 85</span> */</span><span class="WHIT">
<span class='line'> 86</span> </span><span class="NAME">Cal3D.CalError.printLastError</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 87</span> </span><span class="WHIT">	</span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="STRN">'not implemented error'</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 88</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 89</span> 
<span class='line'> 90</span> </span><span class="COMM">/**
<span class='line'> 91</span> 	Set all the information about the last error.&lt;br />
<span class='line'> 92</span> 	@param {number} code The code of the last error.
<span class='line'> 93</span> 	@param {string} filename The name of the source file where the last error occured.
<span class='line'> 94</span> 	@param {number} line The line number in the source file where the last error occured.
<span class='line'> 95</span> 	@param {string} text The supplementary description of the last error.
<span class='line'> 96</span> */</span><span class="WHIT">
<span class='line'> 97</span> </span><span class="NAME">Cal3D.CalError.setLastError</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">code</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">filename</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">line</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">text</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 98</span> </span><span class="WHIT">	</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">code</span><span class="WHIT"> </span><span class="PUNC">>=</span><span class="WHIT"> </span><span class="NAME">Cal3D.CalError.Code.MAX_ERROR_CODE</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'> 99</span> </span><span class="WHIT">		</span><span class="NAME">code</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Cal3D.CalError.Code.INTERNAL</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>100</span> 
<span class='line'>101</span> </span><span class="WHIT">	</span><span class="NAME">Cal3D.CalError.m_lastErrorCode</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">code</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>102</span> </span><span class="WHIT">	</span><span class="NAME">Cal3D.CalError.m_lastErrorFile</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">filename</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">filename</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>103</span> </span><span class="WHIT">	</span><span class="NAME">Cal3D.CalError.m_lastErrorLine</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">line</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">line</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>104</span> </span><span class="WHIT">	</span><span class="NAME">Cal3D.CalError.m_lastErrorText</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">text</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">text</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>105</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>106</span> 
<span class='line'>107</span> </span><span class="COMM">/**
<span class='line'>108</span> 	Get description of a given error.&lt;br />
<span class='line'>109</span> 	@param {number} code The error code.
<span class='line'>110</span> 	@returns {string} The description of the given error code.
<span class='line'>111</span> */</span><span class="WHIT">
<span class='line'>112</span> </span><span class="NAME">Cal3D.CalError.getErrorDescription</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">code</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>113</span> </span><span class="WHIT">	</span><span class="KEYW">switch</span><span class="PUNC">(</span><span class="NAME">code</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>114</span> </span><span class="WHIT">	</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>115</span> </span><span class="WHIT">	</span><span class="KEYW">case</span><span class="WHIT"> </span><span class="NAME">Cal3D.CalError.Code.OK</span><span class="PUNC">:</span><span class="WHIT">                         </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="STRN">'No error found'</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>116</span> </span><span class="WHIT">	</span><span class="KEYW">case</span><span class="WHIT"> </span><span class="NAME">Cal3D.CalError.Code.INTERNAL</span><span class="PUNC">:</span><span class="WHIT">                   </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="STRN">'Internal error'</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>117</span> </span><span class="WHIT">	</span><span class="KEYW">case</span><span class="WHIT"> </span><span class="NAME">Cal3D.CalError.Code.INVALID_HANDLE</span><span class="PUNC">:</span><span class="WHIT">             </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="STRN">'Invalid handle as argument'</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>118</span> </span><span class="WHIT">	</span><span class="KEYW">case</span><span class="WHIT"> </span><span class="NAME">Cal3D.CalError.Code.MEMORY_ALLOCATION_FAILED</span><span class="PUNC">:</span><span class="WHIT">   </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="STRN">'Memory allocation failed'</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>119</span> </span><span class="WHIT">	</span><span class="KEYW">case</span><span class="WHIT"> </span><span class="NAME">Cal3D.CalError.Code.FILE_NOT_FOUND</span><span class="PUNC">:</span><span class="WHIT">             </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="STRN">'File not found'</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>120</span> </span><span class="WHIT">	</span><span class="KEYW">case</span><span class="WHIT"> </span><span class="NAME">Cal3D.CalError.Code.INVALID_FILE_FORMAT</span><span class="PUNC">:</span><span class="WHIT">        </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="STRN">'Invalid file format'</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>121</span> </span><span class="WHIT">	</span><span class="KEYW">case</span><span class="WHIT"> </span><span class="NAME">Cal3D.CalError.Code.FILE_PARSER_FAILED</span><span class="PUNC">:</span><span class="WHIT">         </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="STRN">'Parser failed to process file'</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>122</span> </span><span class="WHIT">	</span><span class="KEYW">case</span><span class="WHIT"> </span><span class="NAME">Cal3D.CalError.Code.INDEX_BUILD_FAILED</span><span class="PUNC">:</span><span class="WHIT">         </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="STRN">'Building of the index failed'</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>123</span> </span><span class="WHIT">	</span><span class="KEYW">case</span><span class="WHIT"> </span><span class="NAME">Cal3D.CalError.Code.NO_PARSER_DOCUMENT</span><span class="PUNC">:</span><span class="WHIT">         </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="STRN">'There is no document to parse'</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>124</span> </span><span class="WHIT">	</span><span class="KEYW">case</span><span class="WHIT"> </span><span class="NAME">Cal3D.CalError.Code.INVALID_ANIMATION_DURATION</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="STRN">'The duration of the animation is invalid'</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>125</span> </span><span class="WHIT">	</span><span class="KEYW">case</span><span class="WHIT"> </span><span class="NAME">Cal3D.CalError.Code.BONE_NOT_FOUND</span><span class="PUNC">:</span><span class="WHIT">             </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="STRN">'Bone not found'</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>126</span> </span><span class="WHIT">	</span><span class="KEYW">case</span><span class="WHIT"> </span><span class="NAME">Cal3D.CalError.Code.INVALID_ATTRIBUTE_VALUE</span><span class="PUNC">:</span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="STRN">'Invalid attribute value'</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>127</span> </span><span class="WHIT">	</span><span class="KEYW">case</span><span class="WHIT"> </span><span class="NAME">Cal3D.CalError.Code.INVALID_KEYFRAME_COUNT</span><span class="PUNC">:</span><span class="WHIT">     </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="STRN">'Invalid number of keyframes'</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>128</span> </span><span class="WHIT">	</span><span class="KEYW">case</span><span class="WHIT"> </span><span class="NAME">Cal3D.CalError.Code.INVALID_ANIMATION_TYPE</span><span class="PUNC">:</span><span class="WHIT">     </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="STRN">'Invalid animation type'</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>129</span> </span><span class="WHIT">	</span><span class="KEYW">case</span><span class="WHIT"> </span><span class="NAME">Cal3D.CalError.Code.FILE_CREATION_FAILED</span><span class="PUNC">:</span><span class="WHIT">       </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="STRN">'Failed to create file'</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>130</span> </span><span class="WHIT">	</span><span class="KEYW">case</span><span class="WHIT"> </span><span class="NAME">Cal3D.CalError.Code.FILE_WRITING_FAILED</span><span class="PUNC">:</span><span class="WHIT">        </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="STRN">'Failed to write to file'</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>131</span> </span><span class="WHIT">	</span><span class="KEYW">case</span><span class="WHIT"> </span><span class="NAME">Cal3D.CalError.Code.INCOMPATIBLE_FILE_VERSION</span><span class="PUNC">:</span><span class="WHIT">  </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="STRN">'Incompatible file version'</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>132</span> </span><span class="WHIT">	</span><span class="KEYW">case</span><span class="WHIT"> </span><span class="NAME">Cal3D.CalError.Code.NO_MESH_IN_MODEL</span><span class="PUNC">:</span><span class="WHIT">           </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="STRN">'No mesh attached to the model'</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>133</span> </span><span class="WHIT">	</span><span class="KEYW">case</span><span class="WHIT"> </span><span class="NAME">Cal3D.CalError.Code.BAD_DATA_SOURCE</span><span class="PUNC">:</span><span class="WHIT">            </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="STRN">'Cannot read from data source'</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>134</span> </span><span class="WHIT">	</span><span class="KEYW">case</span><span class="WHIT"> </span><span class="NAME">Cal3D.CalError.Code.NULL_BUFFER</span><span class="PUNC">:</span><span class="WHIT">                </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="STRN">'Memory buffer is null'</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>135</span> </span><span class="WHIT">	</span><span class="KEYW">case</span><span class="WHIT"> </span><span class="NAME">Cal3D.CalError.Code.INVALID_MIXER_TYPE</span><span class="PUNC">:</span><span class="WHIT">         </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="STRN">'The CalModel mixer is not a CalMixer instance'</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>136</span> </span><span class="WHIT">	</span><span class="KEYW">default</span><span class="PUNC">:</span><span class="WHIT">											 </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="STRN">'Unknown error'</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>137</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>138</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>139</span> 
<span class='line'>140</span> </span><span class="COMM">/**
<span class='line'>141</span> 	Get description of the last error.&lt;br />
<span class='line'>142</span> 	@returns {string} The description of the last error.
<span class='line'>143</span> */</span><span class="WHIT">
<span class='line'>144</span> </span><span class="NAME">Cal3D.CalError.getLastErrorDescription</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>145</span> </span><span class="WHIT">	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">Cal3D.CalError.getErrorDescription</span><span class="PUNC">(</span><span class="NAME">Cal3D.CalError.getLastErrorCode</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>146</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>147</span> 
<span class='line'>148</span> </span><span class="NAME">Cal3D.CalError.m_lastErrorCode</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Cal3D.CalError.Code.OK</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>149</span> </span><span class="NAME">Cal3D.CalError.m_lastErrorFile</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>150</span> </span><span class="NAME">Cal3D.CalError.m_lastErrorLine</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>151</span> </span><span class="NAME">Cal3D.CalError.m_lastErrorText</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>152</span> </span></pre></body></html>